home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 100 / CD-ROM 100.iso / aplic / oo1_1 / f_0020 / sbasic.jar / text / sbasic / common / 03020405.xml < prev    next >
Encoding:
Extensible Markup Language  |  2003-04-30  |  7.1 KB  |  66 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>FileAttr-Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03020405"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         table.Tabelle1{
  5.                 }
  6.         span.Tabelle1A{
  7.                 width:1.499cm;}
  8.         span.Tabelle1B{
  9.                 width:16.498cm;}
  10.         tr.Tabelle11{
  11.                 }
  12.         td.Tabelle1A1{
  13.                 }
  14.         p.P1{
  15.                 }
  16.         span.T1{
  17.                 font-weight:bold;}
  18.         span.fr1{
  19.                 }
  20.         </style></head><body>
  21.   
  22.   
  23.   <help:paragraphinfo state="E" xmlns:help="http://openoffice.org/2000/help"/><help:to-be-embedded Eid="fileattr" xmlns:help="http://openoffice.org/2000/help">
  24.   <p class="Head1"><help:paragraphinfo state="U" number="1"/><help:key-word value="FileAttr; function" tag="kw66567_1"/><help:link Id="66567">FileAttr-Function [Runtime]</help:link></p>
  25.   <p class="Paragraph"><help:paragraphinfo state="U" number="2"/>Returns the access mode or the file access number of a file that was opened with the Open statement. The file access number is dependent on the operating system (OSH = Operating System Handle).</p>
  26.   <help:paragraphinfo state="E"/></help:to-be-embedded>
  27.   <table><tr class="Tabelle11"><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1A">
  28.       <p class="TextInTable"><draw:image draw:name="Icon0" svg:desc="This icon marks text containing additional information." svg:pixelx="32" svg:pixely="32" svg:width="0.847cm" svg:height="0.847cm" xlink:href="65980" draw:filter-name="" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/></p>
  29.  
  30.      </span></th><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1B">
  31.       <p class="TextInTable"><help:paragraphinfo state="U" number="3" xmlns:help="http://openoffice.org/2000/help"/>If you use a 32-Bit operating system, you cannot use the FileAttr-Function to determine the file access number.</p>
  32.      </span></th></tr></table>
  33.   <p class="Paragraph"><help:paragraphinfo state="U" number="4" xmlns:help="http://openoffice.org/2000/help"/>See also: <help:link Id="66386" Eid="open" xmlns:help="http://openoffice.org/2000/help">Open</help:link></p>
  34.   <p class="Head2"><help:paragraphinfo state="U" number="5" xmlns:help="http://openoffice.org/2000/help"/>Syntax:</p>
  35.   <p class="Paragraph"><help:paragraphinfo state="U" number="6" xmlns:help="http://openoffice.org/2000/help"/>FileAttr (FileNumber As Integer, Attribute As Integer)</p>
  36.   <p class="Head2"><help:paragraphinfo state="U" number="7" xmlns:help="http://openoffice.org/2000/help"/>Return value:</p>
  37.   <p class="Paragraph"><help:paragraphinfo state="U" number="8" xmlns:help="http://openoffice.org/2000/help"/>Integer</p>
  38.   <p class="Head2"><help:paragraphinfo state="U" number="9" xmlns:help="http://openoffice.org/2000/help"/>Parameters:</p>
  39.   <p class="Paragraph"><help:paragraphinfo state="U" number="10" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">FileNumber:</span> The number of the file that was opened with the Open statement.</p>
  40.   <p class="Paragraph"><help:paragraphinfo state="U" number="11" xmlns:help="http://openoffice.org/2000/help"/><span class="T1">Attribute:</span> Integer expression that indicates the type of file information that you to return. The following values are possible:</p>
  41.   <p class="Paragraph"><help:paragraphinfo state="U" number="12" xmlns:help="http://openoffice.org/2000/help"/>1: The FileAttr-Function indicates the access mode of the file.</p>
  42.   <p class="Paragraph"><help:paragraphinfo state="U" number="13" xmlns:help="http://openoffice.org/2000/help"/>2: The FileAttr-Function returns the file access number of the operating system.</p>
  43.   <p class="Paragraph"><help:paragraphinfo state="U" number="14" xmlns:help="http://openoffice.org/2000/help"/>If you specify a parameter attribute with a value of 1, the following return values apply:</p>
  44.   <p class="Paragraph"><help:paragraphinfo state="U" number="15" xmlns:help="http://openoffice.org/2000/help"/>1 - INPUT (file open for input)</p>
  45.   <p class="Paragraph"><help:paragraphinfo state="U" number="16" xmlns:help="http://openoffice.org/2000/help"/>2 - OUTPUT (file open for output)</p>
  46.   <p class="Paragraph"><help:paragraphinfo state="U" number="17" xmlns:help="http://openoffice.org/2000/help"/>4 - RANDOM (file open for random access)</p>
  47.   <p class="Paragraph"><help:paragraphinfo state="U" number="18" xmlns:help="http://openoffice.org/2000/help"/>8 - APPEND (file open for appending)</p>
  48.   <p class="Paragraph"><help:paragraphinfo state="U" number="19" xmlns:help="http://openoffice.org/2000/help"/>32 - BINARY (file open in binary mode).</p>
  49.   <p class="Paragraph"><help:paragraphinfo state="S" xmlns:help="http://openoffice.org/2000/help"/><help:embedded Id="66475" Eid="errorcode" xmlns:help="http://openoffice.org/2000/help"/></p>
  50.   <p class="Paragraph"><help:paragraphinfo state="S" xmlns:help="http://openoffice.org/2000/help"/><help:embedded Id="66475" Eid="err5" xmlns:help="http://openoffice.org/2000/help"/></p>
  51.   <p class="Paragraph"><help:paragraphinfo state="S" xmlns:help="http://openoffice.org/2000/help"/><help:embedded Id="66475" Eid="err52" xmlns:help="http://openoffice.org/2000/help"/></p>
  52.   <p class="Head2"><help:paragraphinfo state="U" number="20" xmlns:help="http://openoffice.org/2000/help"/>Example:</p>
  53.   <p class="PropText"><help:paragraphinfo state="U" number="21" xmlns:help="http://openoffice.org/2000/help"/>Sub ExampleFileAttr</p>
  54.   <p class="PropText"><help:paragraphinfo state="U" number="22" xmlns:help="http://openoffice.org/2000/help"/>Dim iNumber As Integer</p>
  55.   <p class="PropText"><help:paragraphinfo state="U" number="23" xmlns:help="http://openoffice.org/2000/help"/>Dim sLine As String</p>
  56.   <p class="PropText"><help:paragraphinfo state="U" number="24" xmlns:help="http://openoffice.org/2000/help"/>Dim aFile As String</p>
  57.   <p class="PropText"><help:paragraphinfo state="U" number="25" xmlns:help="http://openoffice.org/2000/help"/>aFile = "c:\data.txt"</p>
  58.   <p class="PropText"><help:paragraphinfo state="U" number="26" xmlns:help="http://openoffice.org/2000/help"/></p>
  59.   <p class="PropText"><help:paragraphinfo state="U" number="27" xmlns:help="http://openoffice.org/2000/help"/>iNumber = Freefile</p>
  60.   <p class="PropText"><help:paragraphinfo state="U" number="28" xmlns:help="http://openoffice.org/2000/help"/>Open aFile For Output As #iNumber</p>
  61.   <p class="PropText"><help:paragraphinfo state="U" number="29" xmlns:help="http://openoffice.org/2000/help"/>Print #iNumber, "This is a line of text"</p>
  62.   <p class="PropText"><help:paragraphinfo state="U" number="30" xmlns:help="http://openoffice.org/2000/help"/>MsgBox FileAttr(#iNumber, 1 ),0,"Access mode"</p>
  63.   <p class="PropText"><help:paragraphinfo state="U" number="31" xmlns:help="http://openoffice.org/2000/help"/>MsgBox FileAttr(#iNumber, 2 ),0,"File attribute"</p>
  64.   <p class="PropText"><help:paragraphinfo state="U" number="32" xmlns:help="http://openoffice.org/2000/help"/>Close #iNumber</p>
  65.   <p class="PropText"><help:paragraphinfo state="U" number="33" xmlns:help="http://openoffice.org/2000/help"/>End Sub</p>
  66.  </body></html>